GetData Method
The GetData procedure method allows you to programatically retrieve data arguments for an IDL graphic after it has been created.
The arguments to the GetData method should be specified in the same manner as the function call used to create the graphic. You may not get the value of non-data arguments or properties.
Coordinate Systems
For the Arrow, Polygon, Polyline, and Symbol graphics, if the graphic is created in data coordinates (with the DATA keyword), the coordinates are returned in data coordinates. If the graphic is created in device coordinates (with the DEVICE keyword) or normalized coordinates (with the NORMAL keyword, the default value for creation), the coordinates are returned in normalized coordinates. The ConvertCoord Method may be used to convert values from one coordinate system to another.
Automatic Gridding
For the Image, Contour, and Surface graphics, if the original data was automatically gridded, then GetData will return the data on the regular grid, not the original data.
Example
PRECIP=[0.5,0.7,1.2,1.8,2.5,1.6,1.9]
DAY=[7, 8, 9, 10, 11, 12, 13]
; Display the first plot to display the precipitation data.
p1 = PLOT(DAY, PRECIP, 'r-:2', $
TITLE = 'Denver Precipitation', $
YTITLE = 'Inches', XTITLE= 'June Date')
p1.GetData, date, rain
PRINT, 'Rain on June 10', rain[3]
Syntax
graphic.GetData, Argument1, Argument2, ... Argumentn [, BOTTOM_VALUES=value] [, CONNECTIVITY=value]
Arguments
The output arguments depend on the graphic being queried and the number of arguments supplied. The form of the arguments is similar to the arguments supplied for the creation of the graphic.
The following table lists the form of return arguments for the IDL graphics functions that support the GetData method.
Graphic |
1 Arg |
2 Args |
3 Args |
4 Args |
Keywords |
Coordinates |
---|---|---|---|---|---|---|
|
X, Y |
|
|
|
NORMAL unless created with /DATA |
|
Y |
X, Y |
|
|
BOTTOM_VALUES |
DATA |
|
Values |
Locations, Values |
|
|
|
DATA |
|
|
X, Y |
|
|
|
DATA |
|
Z |
|
Z, X, Y |
|
|
DATA |
|
|
Y, Yerror |
X, Y, Yerror |
X, Y, Xerror, Yerror |
|
DATA |
|
Y |
X, Y |
|
|
|
DATA |
|
Image |
|
Image, X, Y |
|
|
DATA |
|
|
|
X, Y, Z |
|
|
DATA |
|
Y |
X, Y |
|
|
|
DATA |
|
Theta |
R, Theta |
|
|
|
DATA |
|
|
X, Y |
X, Y, Z |
|
CONNECTIVITY |
NORMAL unless created with /DATA |
|
|
X, Y |
X, Y, Z |
|
CONNECTIVITY |
NORMAL unless created with /DATA |
|
|
X, Y |
|
|
|
DATA |
|
|
|
X, Y, Z |
|
|
DATA |
|
|
U, V |
|
U, V, X, Y |
|
DATA |
|
Z |
|
Z, X, Y |
|
|
DATA |
|
|
X, Y |
|
|
|
NORMAL unless created with /DATA |
|
|
U, V |
|
U, V, X, Y |
|
DATA |
|
Vol0 |
Vol0, Vol1 |
|
Vol0, Vol1, Vol2, Vol3 |
|
DATA |
Keywords
BOTTOM_VALUES
This keyword applies only to the Barplot graphic, and allows you to retrieve the BOTTOM_VALUES data.
CONNECTIVITY
This keyword applies only to POLYLINE and POLYGON graphics, and allows you to retrieve the CONNECTIVITY data.
Version History
8.1 |
Introduced |